package com.uikoo9.manage.y.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.uikoo9.util.core.annotation.QTable;
import com.uikoo9.util.core.data.QStringUtil;

/**
 * YJobModel<br>
 * id	id<br>
 * cuser_id	创建者<br>
 * cuser_name	创建<br>
 * cdate	创建时间<br>
 * y_job_job	class<br>
 * y_job_cron	执行表达式<br>
 * y_job_enable	开启1关闭0<br>
 * y_job_group	分组<br>
 * y_job_remark	说明<br>
 * @author qiaowenbin
 */
@QTable("t_y_job")
@SuppressWarnings("serial")
public class YJobModel extends Model<YJobModel>{
	
	public static final YJobModel dao = new YJobModel();
	
	/**
	 * find all
	 * @return
	 */
	public List<YJobModel> findAll(){
		return findAll(null);
	}
	
	/**
	 * find all by order
	 * @param order
	 * @return
	 */
	public List<YJobModel> findAll(String order){
		StringBuilder sb = new StringBuilder("select * from t_y_job ");
		if(QStringUtil.isEmpty(order)){
			return dao.find(sb.append("order by id desc").toString());
		}else{
			return dao.find(sb.append(order).toString());
		}
	}
	
}
